package com.chenshu.shop.mapper;

import com.chenshu.shop.model.Good;
import com.chenshu.shop.model.Top;
import com.chenshu.shop.model.Type;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2024-06-06
 * Time：08:58
 */
@Mapper
public interface GoodMapper {
    public List<Good> selectAllGoods();

    public List<Good> selectGoodsByPage(@Param("begin") Integer begin, @Param("end") Integer end);

    public Integer selectGoodsCount();

    public Good selectGoodById(Integer id);

    public List<Type> selectAllTypes();

    public Integer updateGoodInfo(Good good);

    public List<Integer> selectAllTopIds();

    public List<Good> selectTopGoodsByPage(@Param("ids") List<Integer> topIds,
                                           @Param("begin") Integer begin, @Param("end") Integer end);

    public Integer addTop(Top top);

    public Integer deleteTop(Integer goodId);

    public Integer addGoods(Good good);

    public Integer deleteGoods(Integer goodsId);

    public List<Good> selectTopGoodsByPageAndType(@Param("typeId") Integer typeId,
                                                  @Param("begin") Integer begin,
                                                  @Param("end") Integer end);

    public Integer selectGoodsCountByType(Integer typeId);

    public List<Good> selectTop6Goods();

    public List<Good> selectMoreTop(@Param("begin") Integer begin,@Param("end") Integer end);

    public Integer selectTopCount();

    public List<Good> selectHot8Goods();

    public List<Good> selectMoreHot(@Param("begin") Integer begin, @Param("end") Integer end);

    public List<Good> selectSearchGoods(@Param("search") String search, @Param("begin") Integer begin, @Param("end") Integer end);

    public Integer selectSearchCount(String search);

    public List<Good> select10New();
}
